'use strict';

var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault');
Object.defineProperty(exports, '__esModule', {
  value: true,
});
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require('@babel/runtime/helpers/objectSpread2'));
var _objectWithoutProperties2 = _interopRequireDefault(
  require('@babel/runtime/helpers/objectWithoutProperties'),
);
var _react = _interopRequireDefault(require('react'));
var _antd = require('antd');
var _createField = _interopRequireDefault(require('../../createField'));
var _FieldContext = require('../../contexts/FieldContext');
var _excluded = ['children'];
/* @ts-ignore */
var TreeSelect = function TreeSelect(_ref) {
  var children = _ref.children,
    rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var _useFieldContext = (0, _FieldContext.useFieldContext)(),
    label = _useFieldContext.label;
  return /*#__PURE__*/ _react.default.createElement(
    _antd.TreeSelect,
    (0, _objectSpread2.default)(
      {
        placeholder: '\u8BF7\u8F93\u5165'.concat(label),
      },
      rest,
    ),
    children,
  );
};
var TreeSelectField = (0, _createField.default)(TreeSelect);
var FinalTreeSelect = TreeSelectField;
FinalTreeSelect.TreeNode = _antd.TreeSelect.TreeNode;
FinalTreeSelect.SHOW_ALL = _antd.TreeSelect.SHOW_ALL;
FinalTreeSelect.SHOW_PARENT = _antd.TreeSelect.SHOW_PARENT;
FinalTreeSelect.SHOW_CHILD = _antd.TreeSelect.SHOW_CHILD;
var _default = FinalTreeSelect;
exports.default = _default;
